import { RouteRecordRaw } from 'vue-router';

const router: RouteRecordRaw[] = [
    {
        path: '/',
        component: () => import('@/view/home/layout/RootLayout.vue'),
        children: [
            {
                path: '/login',
                name: 'Login',
                component: () => import('@/view/home/login/Login.vue'),
            },
            {
                path: '/',
                component: () => import('@/view/home/layout/VerticalLayout.vue'),
                children: [
                    {
                        path: '/',
                        name: 'Home',
                        component: () => import('@/view/home/index/Index.vue'),
                        meta: {
                            key: 'Home',
                            title: '首页',
                            requiredAuth: true,
                        },
                    },
                    {
                        path: '/',
                        name: 'CodeGenerator',
                        component: () => import('@/view/home/code_generator/Index.vue'),
                        children: [
                            {
                                path: '/code_generator/ui',
                                name: 'UiCodeGenerator',
                                component: () => import('@/view/home/code_generator/ui/UiCodeGenerator.vue'),
                                meta: {
                                    title: '前端代码生成器',
                                    key: 'UiCodeGenerator',
                                    requiredAuth: false,
                                },
                            },
                            {
                                path: '/code_generator/bg',
                                name: 'BgCodeGenerator',
                                component: () => import('@/view/home/code_generator/bg/BgCodeGenerator.vue'),
                                meta: {
                                    title: '后端代码生成器',
                                    key: 'BgCodeGenerator',
                                    requiredAuth: false,
                                },
                            },
                        ],
                    },
                    {
                        path: '/user',
                        name: 'User',
                        component: () => import('@/view/home/user/Index.vue'),
                        meta: {
                            title: '用户管理',
                            key: 'User',
                            requiredAuth: true,
                        },
                    },
                    {
                        path: '/',
                        component: () => import('@/view/home/sys/Index.vue'),
                        children: [
                            {
                                path: '/sys/menu',
                                name: 'SysMenu',
                                component: () => import('@/view/home/sys/menu/Index.vue'),
                                meta: {
                                    title: '菜单管理',
                                    key: 'SysMenu',
                                    requiredAuth: false,
                                },
                            },
                            {
                                path: '/sys/role',
                                name: 'SysRole',
                                component: () => import('@/view/home/sys/role/Index.vue'),
                                meta: {
                                    title: '角色管理',
                                    key: 'SysRole',
                                    requiredAuth: false,
                                },
                            },
                            {
                                path: '/sys/dict_type',
                                name: 'SysDictType',
                                component: () => import('@/view/home/sys/dict_type/Index.vue'),
                                meta: {
                                    title: '字典类型管理',
                                    key: 'SysDictType',
                                    requiredAuth: true,
                                },
                            },
                            {
                                path: '/sys/dict',
                                name: 'SysDict',
                                component: () => import('@/view/home/sys/dict/Index.vue'),
                                meta: {
                                    title: '字典数据管理',
                                    key: 'SysDict',
                                    requiredAuth: true,
                                },
                            },
                        ],
                    },
                    {
                        path: '/chat',
                        name: 'Chat',
                        component: () => import('@/view/home/chat/Index.vue'),
                        meta: {
                            title: '聊天室',
                            key: 'Chat',
                            requiredAuth: true,
                        },
                    }
                ],
            },
        ],
    },
];

export default router;
